<?php 
header("cntent-type:text/html;charset=utf-8");
$pdo = new PDO("mysql:host=127.0.0.1;dbname=lx","root","root");
$sql = "select * from goods";
$res = $pdo -> query($sql)->fetchAll(PDO::FETCH_ASSOC);
print_r($res);
$i=0;
foreach ($res as $key => $value) {
	$stime = $res[$i]['stime'];
	$stime = strtotime($stime);
	$time = $stime-time();
	$hour = floor($time/3600);
	$min = floor(($time-$hour*3600)/60);
	$sec = $time-$hour*3600-$min*60;
	echo json_encode(array('hour'=>$hour,'min'=>$min,'sec'=>$sec));
	// print_r($time);
	$i++;
}








 ?>